package com.liang.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.liang.common.to.mq.SeckillOrderTo;
import com.liang.common.utils.PageUtils;
import com.liang.gulimall.order.entity.OrderEntity;
import com.liang.gulimall.order.vo.OrderConfirmVo;
import com.liang.gulimall.order.vo.PayAsyncVo;
import com.liang.gulimall.order.vo.SubmitOrderResponseVo;
import com.liang.gulimall.order.vo.SubmitOrderVo;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author sdl
 * @email 675184354@qq.com
 * @date 2020-05-24 16:16:47
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 给订单确认页返回需要的数据
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单
     * @param submitOrderVo
     * @return
     */
    SubmitOrderResponseVo submitOrder(SubmitOrderVo submitOrderVo);

    void orderClose(OrderEntity orderEntity);

    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 支付完成后异步回调处理订单
     * @param payAsyncVo
     * @return
     */
    String handlePayResult(PayAsyncVo payAsyncVo);

    /**
     * 秒杀订单处理
     * @param seckillOrderTo
     */
    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}

